package com.hsq.ndmall.wx.feign.order;

import com.hsq.ndmall.common.utils.R;
import com.hsq.ndmall.wx.vo.order.CartVo;
import com.hsq.ndmall.wx.vo.order.OrderGoods;
import com.hsq.ndmall.wx.vo.order.OrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 黄四清
 * @version 1.0.0
 * @ClassName OrderFeign.java
 * @Description TODO
 * @createTime 2021年08月19日 20:14:00
 */
@FeignClient("order-service")
public interface OrderFeign {

    @PostMapping("/order/order/save")
    R submitOrder(@RequestParam Map<String, Object> params);

    @GetMapping("order/cart/list")
    R list(@RequestParam Map<String, Object> params);

    @PostMapping("/order/cart/save")
    R save(@RequestBody CartVo cart);

    @PutMapping("/order/cart/update")
    R update(@RequestBody CartVo cart);

    @PostMapping("/order/order/save")
    R orderSave(@RequestBody OrderVo order);

    @PostMapping("/order/ordergoods/save")
    R orderGoodsSave(@RequestBody OrderGoods orderGoods);

    @PostMapping(value = "/order/order/saveCopy" ,consumes ="application/json" )
    R submit(@RequestBody String body);

    @DeleteMapping("/order/order/delete")
    R delete(@RequestBody Integer[] ids);
}
